/**
 * 功能描述
 */

define(function (require, exports, module) {
	
	var Subnav = require("subnav");
	var aw = require("ajaxwrapper");
	var Dialog = require("dialog");
	var events = require("../handler/events")
	
    var instance = {
        initComponent: function (params,widget) {
        	var subnav = new Subnav({
        		parentNode:".J-subnav",
        		
        		model:{
        			title:"菜单设置",
        			items:[{
        				id:"lastWeek",
        				type:"button",
        				text:"上一周",
        				handler:function(){
        					date = widget.date.weekday(-1);
        					events.setData(widget,date);
    					}
        			},{
        				id:"nextWeek",
        				type:"button",
        				text:"下一周",
        				handler:function(date){
        					date = widget.date.weekday(7);
        					events.setData(widget,date);
    					}
        			},{
        				id:"copyToNextWeek",
        				type:"button",
        				text:"复制到下一周",
        				handler:function(date){
        					date = widget.date.weekday(1);
        					events.copyToNextWeek(widget,date);
    					}
        			}]
        			
        		}
        	});
        	widget.set("subnav",subnav);
        }
    };
    module.exports = instance;
});
